a = '\t'.join(map(str, range(10)))

print(a.find('\n'))  # -1
print(a.index('\n'))  # ValueError: substring not found